package com.wigem.approve.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wigem.framework.common.util.common.GuidUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 【审批日志】对象 ge_approve_log
 *
 * @author YMY
 * @date 2023-08-09
 */
@Data
@ApiModel
@TableName("ge_approve_log")
public class GeApproveLogEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 32id
     */
    @ApiModelProperty(value = "32id", name = "id")
    @TableId
    private String id;

    /**
     * 操作用户id
     */
    @ApiModelProperty(value = "操作用户id", name = "userId")
    @TableField(value = "user_id")
    private String userId;

    /**
     * 用户单位
     */
    @ApiModelProperty(value = "用户单位", name = "userUnit")
    @TableField(value = "user_unit")
    private String userUnit;

    /**
     * 用户姓名
     */
    @ApiModelProperty(value = "用户姓名", name = "realName")
    @TableField(value = "real_name")
    private String realName;

    /**
     * 操作信息ID
     */
    @ApiModelProperty(value = "操作信息ID", name = "operateInfoId")
    @TableField(value = "operate_info_id")
    private String operateInfoId;

    /**
     * 操作流程名称
     */
    @ApiModelProperty(value = "操作流程名称", name = "operateProcessName")
    @TableField(value = "operate_process_name")
    private String operateProcessName;

    /**
     * 操作内容
     */
    @ApiModelProperty(value = "操作内容", name = "operateContent")
    @TableField(value = "operate_content")
    private String operateContent;

    /**
     * 操作时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "操作时间", name = "operateTime")
    @TableField(value = "operate_time")
    private Date operateTime;

    /**
     * 操作原因
     */
    @ApiModelProperty(value = "操作原因", name = "operateReason")
    @TableField(value = "operate_reason")
    private String operateReason;

    public void create() {
        this.id = GuidUtils.generate();
    }

    public void modify(String keyValue) {
        this.id = keyValue;
    }

}
